package PTA3.ti4401;

import java.util.Scanner;

/**
 * @author Lenovo
 */
class Person{
    private  String name;
    private int age;

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getAge() {
        return age;
    }

    public String getName() {
        return name;
    }
    public Person(String name,int age){
        this.age=age;
        this.name=name;
    }
    public Person(){
        this("none",1);
    }

    public String toString() {
        return "Person [name=" + name + ", age=" + age + "]";
    }

}
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n= scanner.nextInt();
        Person[] persons=new Person[n];
        for (int i=0;i<n;i++){
            String name= scanner.next();
            int age = scanner.nextInt();
            persons[i]=new Person(name,age);
        }
        for(Person person:persons){
            System.out.println(person);
        }
        String input=scanner.next();
        boolean flag=false;
        for(Person person:persons){
            if(person.getName().equals(input)){
                System.out.println("查询结果：");
                System.out.println(person);
                flag=true;
            }
        }
        if(!flag){
            System.out.println("not found");
        }
        scanner.close();
    }

}
